<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>绝对定位</title>
		<style>
			div{
				width: 300px;
				background-color: rgba(0, 0, 0, 0.3);
				padding: 10px;
				position: relative;
			}
			input{
				width: 300px;
				border: none;
				padding: 10px 20px;
				/* 自带变框会影响显示 */
				box-sizing: border-box;
			}
			img{
				position: absolute;
				top: 14px;
				right: 30px;
			}
			p{
				font-size: 12px;
				color: red;
				margin: 0;
			}
		</style>
	</head>
	<body>
		<div>
			<input type="text" placeholder="请输入用户名">
			<img src="http://doc.canglaoshi.org/tstore_v1/images/login/yhm.png" alt="">
			<p>用户名不能为空</p>
		</div>
	</body>
</html>